open(BUFF,"ref_snps");
while(<BUFF>)
{
	chomp($_);
	@a = split("\t",$_);
	$hash{$a[0]}=$a[1];
}
#open(BUFF,"mcbcs_bcac_icogs_glioma1.map");
#open(WRBUFF,">mcbcs_bcac_icogs_glioma.map");
$dir='TRIPLE_NEG';
open(BUFF,"./$dir/tnicogs_clean_glioma_1.map");
open(WRBUFF,">./$dir/tnicogs_clean_glioma.map");
open(WRBUFF1,">./$dir/remove_tnicogs_clean_glioma.map");
$exists = 0;
$equal = 0;
$nonequal = 0;	
while(<BUFF>)
{
        chomp($_);
        @a = split("\t",$_);
	if(exists($hash{$a[1]}))
	{
		#$a[3]=$hash{$a[1]};
		$exists++;
		if($hash{$a[1]} eq $a[3])
		{
			$equal++;
		}
		else
		{
			$nonequal++;
			$a[3]=$hash{$a[1]};
		}
		
	}
	else
	{
		print WRBUFF1 $_."\n";
	}
	$_=join("\t",@a);
	print WRBUFF $_."\n";
}
print "Exists:$exists Equal:$equal NotEqual:$nonequal\n"; 
